package zust.se.delicious.service.impl;

import java.util.List;

import zust.se.delicious.dao.FollowDao;
import zust.se.delicious.dao.UserDao;
import zust.se.delicious.domain.Follow;
import zust.se.delicious.domain.User;
import zust.se.delicious.service.TestService;

public class TestServiceImpl implements TestService {
	private UserDao userDao;
	private FollowDao followDao;

	@Override
	public void test() {
		testUserDao();
		testFollowDao();
	}
	
	private void testUserDao() {
/*		User user = new User();
		user.setUsername("fuck you");
		userDao.save(user);*/
    /*  user.setId(1);
		userDao.delete(user);*/
/*		User user = userDao.findByNameAndPass("fuck you", "111");
		System.out.println(user.getUsername());
		System.out.println(user.getPassword());*/
		
	}
	
	private void testFollowDao() {
/*		Follow follow = new Follow();
		User follower = new User();
		User following = new User();
		follower.setId(1);
		following.setId(2);
		follow.setFollower(follower);
		follow.setFollowing(following);
		followDao.save(follow);*/
	/*	List<Follow> follower = followDao.findFollowerByUser_id(2);
		System.out.println("size = " + follower.size());
		for (Follow follow : follower) {
			System.out.println(follow.getFollowing().getUsername() + " 关注了 " + follow.getFollower().getUsername());
		}*/

	}

	public UserDao getUserDao() {
		return userDao;
	}

	public void setUserDao(UserDao userDao) {
		this.userDao = userDao;
	}

	public FollowDao getFollowDao() {
		return followDao;
	}

	public void setFollowDao(FollowDao followDao) {
		this.followDao = followDao;
	}
	
	

}
